<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>

<%@page import="com.google.appengine.api.users.User" %>
<%@page import="com.google.appengine.api.users.UserService"%>
<%@page import="com.google.appengine.api.users.UserServiceFactory"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Main Menu</title>
</head>
<body>
	<center>
	<h1>Main Menu</h1>
	
	<%
		UserService userService= UserServiceFactory.getUserService();
		User user= userService.getCurrentUser();
	%>
	
	<%
		if (user == null){
			String url= userService.createLoginURL(request.getRequestURI());
	%>
	
			 
			<a href="<%= url%>">SIGN IN</a> 
				
		
	<% } else{
			String url= userService.createLogoutURL(request.getRequestURI());
	
	%>
	<a href="<%= url%>">SIGN OUT</a> <br /><br />
	Logged in as <%=user %> <br /><br />
    Click <a href="lobby.jsp">here</a> to go to game lobby <br />
    Click <a href="leaderboard.jsp">here</a> to view leaderboard <br />



	<% } %>

    </center>
</body>
</html>